package ooday01;

public class ExtendsTest {
    public static void main(String[] args) {
        Student zf = new Student();
        zf.name = "张飞";
        zf.age = 13;
        zf.address = "北京";
        zf.className = "601";
        zf.stuId = "001";
        zf.eat();
        zf.sleep();
        zf.sayHi();
        zf.study();
        System.out.println();

        Student lb = new Student("刘备",15,"上海","702","1001");
        lb.eat();
        lb.sleep();
        lb.sayHi();
        lb.study();
        System.out.println();

        Teacher zgl = new Teacher("诸葛亮",26,"天津",8888.88);
        zgl.eat();
        zgl.sleep();
        zgl.sayHi();
        zgl.teach();
        System.out.println();

        Doctor ht = new Doctor("华佗",35,"重庆","主治医师");
        ht.eat();
        ht.sleep();
        ht.sayHi();
        ht.cut();

        Person sq = new Person();
        sq.name = "孙权";
        sq.age = 25;
        sq.address = "南京";
        sq.eat();
        sq.sleep();
        sq.sayHi();
        //p.stuId = "005";//父类不能访问子类
    }
}
